;
; ------------------------------------------------------------
;
;   PureBasic - Math example file
;
;    (c) 2003 - Fantaisie Software
;
; ------------------------------------------------------------
;

Procedure DrawCircle(Parameter)
    
  Repeat 
  
    X.f = Random(80)
    Y.f = X
  
    If StartDrawing(WindowOutput(0))
    
      FrontColor(RGB(Random(255), Random(255), Random(255)))
      For k=0 To 630
        a.f+0.01
        
        x2.f = X*Cos(a) + Y*Sin(a)
        y2.f = X*Sin(a) - Y*Cos(a)
        
        Plot(200+x2, 200+y2)
        Plot(100+x2, 200+y2)

        Delay(10)
      Next
      
      StopDrawing()
    EndIf
  
  ForEver
  
EndProcedure


If OpenWindow(0, 200, 200, 400, 400, "Test")

  CreateThread(@DrawCircle(), 0)
  
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
  
EndIf